import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

export type OrganizationDocument = Organization & Document;

@Schema({ timestamps: true })
export class Organization {
  @Prop({ required: true })
  name: string;

  @Prop()
  description: string;

  @Prop()
  address: string;

  @Prop()
  contactPerson: string;

  @Prop()
  phone: string;

  @Prop()
  email: string;

  @Prop({ default: 1 }) // 0: 禁用, 1: 启用
  status: number;

  @Prop()
  parentId: string;

  @Prop({ default: 0 })
  sort: number;
}

export const OrganizationSchema = SchemaFactory.createForClass(Organization); 